package com.sky.context;

public class BaseContext {

    private static ThreadLocal<Long> empThreadLocal=new ThreadLocal<> ();
    private static ThreadLocal<Long> userThreadLocal=new ThreadLocal<> ();

    public static void setCurrentEmpId(Long empId){
        empThreadLocal.set(empId);
    }

    public static void setCurrentUserId(Long userId){
        userThreadLocal.set(userId);
    }

    public static Long getCurrentEmpId(){
        return empThreadLocal.get();
    }

    public static Long getCurrentUserId(){
        return userThreadLocal.get();
    }

    public static void clearCurrentEmpId(){
        empThreadLocal.remove();
    }

    public static void clearCurrentUserId(){
        userThreadLocal.remove();
    }
}
